﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LabelPrintSystem
{
    public partial class FrmConfig : Form
    {
        public FrmConfig(string bar, string qr, string sNokiaT, bool cbNokia,bool isckqr)
        {
            InitializeComponent();
            barcode = bar;
            qrcode = qr;
            isNokia = cbNokia;
            sNokia = sNokiaT;
            isCheckQrCode = isckqr;
        }
        private string barcode;
        private string qrcode;
        private string sNokia;
        private bool isNokia;
        private bool isCheckQrCode;
        private void FrmConfig_Load(object sender, EventArgs e)
        {
            cbNokia.Checked = isNokia;
            txtBarCode.Text = barcode;
            txtQrCode.Text = qrcode;
            txtNokia.Text = sNokia;
            ckQrCode.Checked = isCheckQrCode;                
        }

        private void cbNokia_CheckedChanged(object sender, EventArgs e)
        {
            if (cbNokia.Checked)
            {
                txtNokia.Text = "S";
                txtBarCode.Text = "B2";
                txtQrCode.Text = "二维码";
            }
            else
            {
                txtNokia.Text = "S";
                txtBarCode.Text = "条码";
                txtQrCode.Text = "二维码";
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }   
    }
}
